home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / datetest.mrbk < prev    next >
Text File  |  1994-09-06  |  1KB  |  72 lines

  1. /* datetest.mrbk */
  2.  
  3. /* This ARexx script invokes MRBackup's date requester. */
  4.  
  5. signal on ERROR
  6. signal on BREAK_C
  7.  
  8. parse source type res called resolved ext host
  9.  
  10. options results
  11.  
  12. if ~(Show('P', 'MRBackup_#1')) then do
  13.     say "You must run MRBackup first. With a little work, you could"
  14.     say "get this ARexx script to do it for you."
  15.     exit 1
  16. end
  17.  
  18. address "MRBackup_#1"
  19.  
  20. poptofront
  21.  
  22. gettestdate
  23. if rc ~= 0 then do
  24.     say "Failed to get test date; rc = " || rc
  25.     exit rc
  26. end
  27.  
  28. say "Current test date: " || result
  29.  
  30.  
  31. say "Getting current date format..."
  32. 'dateformat'
  33. currentDateFormat = result
  34. say "Current date format is " || currentDateFormat
  35.  
  36. say "Setting date format to 2 (USA)..."
  37. 'dateformat' "2"
  38.  
  39. /* newDate = "09/01/94 12:00:00" */
  40. newDate = "09/01/94 12:01:02"
  41. say "Setting test date to " || newDate
  42.  
  43. settestdate newDate
  44. if rc ~= 0 then do
  45.     say "Failed to set test date; rc = " || rc
  46.     exit rc
  47. end
  48.  
  49. say "  Final test date: " || result
  50.  
  51. 'notealert "Date test completed."'
  52.  
  53. exit 0
  54.  
  55.  
  56. /*------------------------------------------------------------------*/
  57.  
  58. break_c:
  59.  
  60. say "*** Control-C recieved.  Stopped by user. ***"
  61. exit 5
  62.  
  63. /*------------------------------------------------------------------*/
  64.  
  65. error:
  66.  
  67. say "Error"
  68. exit 6
  69.  
  70. /*------------------------------------------------------------------*/
  71.  
  72.